package main.items.ball

import main.items.TransferItemAction
import main.models.StateAction
import main.person.{Emotion, Person}
import main.state.{State, StateLens}

case class ThrowBallAction(from: StateLens[Person], to: StateLens[Person], ball: StateLens[Ball]) extends StateAction {
  override def apply(implicit state: State): State = {
    val state1 = state(TransferItemAction(from, to, ball))
    to.map(state1, a => a.setEmotion(Emotion.Rage))
  }
}
